Platform Explorer / Nuxeo Platform 2021.53

Component org.nuxeo.ecm.platform.audit.service.NXAuditEventsService

Documentation

Service that deals with audit.

Most of the work is done at EJB layer though.

This supports JMS events based notifications on a dedicated topic.

@version 1.0

Requirements

Resolution Order

824
The resolution order represents the order in which this component has been resolved by the Nuxeo Runtime framework.
You can influence this order by adding "require" tags in your component declaration, to make sure it is resolved after another component.

Start Order

781 (Declared Start Order: 51)
The start order represents the order in which this component has been started by the Nuxeo Runtime framework.
This number is interesting to tweak if your Java component interacts with other components, and needs to be started before or after another one.
It can be changed by implementing the method "Component#getApplicationStartedOrder()" on your Java component: components are sorted according to this reference value, in increasing order.
The default value is 1000, and the repository initialization uses number 100. Negative values can also be used.

Implementation

Class: org.nuxeo.ecm.platform.audit.service.NXAuditEventsService

Services

Extension Points

Contributions

XML Source

<?xml version="1.0" encoding="UTF-8"?>
<component name="org.nuxeo.ecm.platform.audit.service.NXAuditEventsService">

  <require>org.nuxeo.runtime.metrics.MetricsService</require>

  <documentation>
    Service that deals with audit.
    <p />
    Most of the work is done at EJB layer though.

    This supports JMS events based
    notifications on a dedicated topic.

    @version 1.0
    @author Julien Anguenot
  </documentation>

  <!-- needed so that activation has access to persistence -->
  <require>org.nuxeo.ecm.platform.audit.service.persistence</require>

  <implementation class="org.nuxeo.ecm.platform.audit.service.NXAuditEventsService" />

  <service>
    <provide interface="org.nuxeo.ecm.platform.audit.service.AuditBackend" />
    <provide interface="org.nuxeo.ecm.platform.audit.api.AuditReader" />
    <provide interface="org.nuxeo.ecm.platform.audit.api.AuditLogger" />
    <provide interface="org.nuxeo.ecm.platform.audit.api.Logs" />
    <provide interface="org.nuxeo.ecm.platform.audit.api.DocumentHistoryReader" />
    <provide interface="org.nuxeo.ecm.platform.audit.service.NXAuditEventsService" />
  </service>

  <extension-point name="event">
    <documentation>
      This service registers auditable events.
      <p />
      Registered events are dummy strings for now.
      <p />
      This service is used to filter auditable events from the JMS topic based
      on their names. The following XML snipset give figures out how the default
      event types are selected for auditing.

      <programlisting>
        <extension target="org.nuxeo.ecm.platform.audit.service.NXAuditEventsService" point="event">
          <event name="documentCreated" />
          <event name="documentCreatedByCopy" />
          <event name="documentDuplicated" />
          <event name="documentMoved" />
          <event name="documentRemoved" />
          <event name="documentModified" />
          <event name="documentLocked" />
          <event name="documentUnlocked" />
          <event name="documentSecurityUpdated" />
          <event name="lifecycle_transition_event" />
          <event name="documentTrashed" />
          <event name="documentUntrashed" />
        </extension>
      </programlisting>
    </documentation>

    <object class="org.nuxeo.ecm.platform.audit.service.extension.EventDescriptor" />

  </extension-point>

  <extension-point name="extendedInfo">

    <documentation>
      This service registered extended info mappings.

      <p />
      This service is used to evaluate EL expression using document as context
      regist:ering results into a map indexed by names.
    </documentation>

    <object class="org.nuxeo.ecm.platform.audit.service.extension.ExtendedInfoDescriptor" />
  </extension-point>

  <extension-point name="adapter">

    <documentation>
      register the adapter that will be injected in EL context
    </documentation>

    <object class="org.nuxeo.ecm.platform.audit.service.extension.AdapterDescriptor" />
  </extension-point>

  <extension-point name="backend">

    <documentation>
      Allows to register a backend implementation for the Audit Service
    </documentation>

    <object class="org.nuxeo.ecm.platform.audit.service.extension.AuditBackendDescriptor" />
  </extension-point>

  <extension-point name="storage">

    <documentation>
      Allows to register a storage implementation for the Audit Service
    </documentation>

    <object class="org.nuxeo.ecm.platform.audit.service.extension.AuditStorageDescriptor" />
  </extension-point>

  <extension-point name="bulk">
    <documentation>
      CAUTION: Deprecated since 10.10, audit bulker is now handled with nuxeo-stream, no replacement
      Allows to configure bulk processing
    </documentation>

    <object class="org.nuxeo.ecm.platform.audit.service.extension.AuditBulkerDescriptor" />
  </extension-point>

  <extension target="org.nuxeo.ecm.platform.audit.service.NXAuditEventsService" point="event">
    <documentation>
      Those default auditable events match Nuxeo core base events.
      <p />
      If you are sending new Nuxeo core events and want them audited, this is
      the place to declare them NXAudit side.
    </documentation>

    <event name="documentCreated" />
    <event name="documentCreatedByCopy" />
    <event name="documentDuplicated" />
    <event name="documentMoved" />
    <event name="documentRemoved" />
    <event name="documentModified" />
    <event name="documentLocked" />
    <event name="documentUnlocked" />
    <event name="documentSecurityUpdated" />
    <event name="retentionActiveChanged" />
    <event name="lifecycle_transition_event" />
    <event name="loginSuccess" />
    <event name="loginFailed" />
    <event name="logout" />
    <event name="documentCheckedIn" />
    <event name="proxyRemoved" />
    <event name="versionRemoved" />
    <event name="documentProxyPublished" />
    <event name="sectionContentPublished" />
    <event name="documentRestored" />
    <event name="download" />
    <event name="documentTrashed" />
    <event name="documentUntrashed" />
    <event name="addedToCollection" />
    <event name="removedFromCollection" />
    <event name="afterMakeRecord" />
    <event name="afterSetRetention" />
    <event name="afterExtendRetention" />
    <event name="retentionExpired" />
    <event name="afterSetLegalHold" />
    <event name="afterRemoveLegalHold" />
    <event name="blobDigestUpdated" />
  </extension>

  <extension target="org.nuxeo.ecm.platform.audit.service.NXAuditEventsService" point="backend">

    <backend class="org.nuxeo.ecm.platform.audit.service.DefaultAuditBackend">
      <require>org.nuxeo.ecm.core.persistence.PersistenceComponent</require>
    </backend>

  </extension>

  <extension target="org.nuxeo.ecm.core.event.EventServiceComponent" point="listener">
    <listener name="auditLoggerListener" async="false" postCommit="false" priority="500"
      class="org.nuxeo.ecm.platform.audit.listener.StreamAuditEventListener" />
  </extension>

  <extension target="org.nuxeo.runtime.stream.service" point="streamProcessor">
    <streamProcessor name="auditWriter" defaultConcurrency="1" defaultPartitions="1"
      defaultCodec="${nuxeo.stream.audit.log.codec:=legacy}" class="org.nuxeo.ecm.platform.audit.impl.StreamAuditWriter"
      enabled="${nuxeo.stream.audit.enabled:=true}">
      <policy name="default" batchCapacity="${nuxeo.stream.audit.batch.size:=10}"
        batchThreshold="${nuxeo.stream.audit.batch.threshold.ms:=50}ms" maxRetries="20" delay="1s" maxDelay="60s"
        continueOnFailure="false" />
    </streamProcessor>
  </extension>

</component>